{% extends 'templates/base_hader.html' %}

{% block content %}

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-1 col-md-1 sidebar">
            <ul class="nav nav-sidebar">
                <li class="active"><a href="/plan/order_list/">工单列表 <span class="sr-only">(current)</span></a>
                </li>
                <li><a href="/plan/plan_list/">计划列表 <span class="sr-only">(current)</span></a></li>
                <li><a href="#"></a></li>
                 <li><a href="#"></a></li>
            </ul>

        </div>
        <div class="col-sm-11 col-md-11 main">
            <div>
            <h2 class="sub-header">工程标准工时列表</h2>

                <button class="btn btn-info pull-right"><a href="{% url 'add_st' %}?next={{ request.get_full_path }}">添加工时</a></button>
            </div>
            <br>
            <form action="" method="get">
                <div class="col-md-6">
                        <div class="">
                            <input type="text" value="" name="query">
                            <input type="submit" class="btn btn-primary" value="搜索">
                        </div>

                    </div>
            </form>

            <form action="" method="post">
                {% csrf_token %}
                <div class="row">
                    <div class="col-md-6">
                        <div>
                            <select name="action">
                                <option value="">----------</option>
                                <option value="multi_init">初始化</option>
                                <option value="delete">删除</option>
                            </select>
                            <button type="submit" class="btn btn-success"><small>提交</small></button>

                        </div>
                    </div>

                </div>

                <div class="table-responsive">
                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th style="width: 20px">选择</th>
                            <th>#</th>
                            <th>机种名</th>
                            <th>工程</th>
                            <th>使用人数</th>
                            <th>1小时产量</th>
                            <th>单台工时(分钟/台)</th>
                            <th>编辑</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for st_obj in st_list %}
                            <tr>
                                <td><input type="checkbox" name="cid" value="{{ order.id }}"></td>
                                <td>{{ forloop.counter }}</td>
                                <td>{{ st_obj.sku.name  }}</td>
                                <td>{{ st_obj.pro }}</td>
                                <td>{{ st_obj.people_number }}</td>
                                <td>{{ st_obj.hour_production }}</td>
                                <td>{{ st_obj.st }}</td>
                                <td>
                                    <div class="dropdown">
                                            <button class="btn btn-info dropdown-toggle " type="button"
                                                    id="dropdownMenu1"
                                                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"
                                                    style="height: 25px">
                                                编辑
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                                <li><a href="{% url 'edit_st' st_obj.id %}?{{ next_url }}">修改</a></li>
{#                                                <li><a href="{% url 'delete_order' order.id %}">删除</a></li>#}

                                            </ul>
                                        </div>
{#                                    <a href="{% url 'edit_order' order.id %}?{{ next_url }}">编辑</a>#}
                                </td>

                            </tr>
                        {% endfor %}


                        </tbody>
                    </table>
                    <div class="pull-right">{{ page_obj.page_html |safe }}</div>
                </div>
            </form>
            <div>
{#                <form action="/plan/order_upload/" method="post" enctype="multipart/form-data">#}
{#                    <h4>批量上传工单↓</h4>#}
{#                    {% csrf_token %}#}
{#                    <input type="file" class="" name="name_file" id="id_file">#}
{#                    <input type="submit">#}
{#                </form>#}
            </div>


        </div>
    </div>
</div>

{% endblock %}


